package com.conference.repository;

import com.conference.entity.ConferenceVenue;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ConferenceVenueRepository extends JpaRepository<ConferenceVenue, Long>, JpaSpecificationExecutor<ConferenceVenue> {
    List<ConferenceVenue> findByConferenceId(Long conferenceId);

    @Query("SELECT COUNT(DISTINCT v.venueName) FROM ConferenceVenue v")
    long countDistinctVenues();
} 